<template>
  <div class="home">
    <mt-swipe :auto="4000">
      <mt-swipe-item v-for="item in swipe" :key="item._id">
        <img :src="item.url" alt="" :title="item.describe">
      </mt-swipe-item>
    </mt-swipe>

    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/home/newsList">
          <img src="./../../assets/images/news.jpg">
          <div class="mui-media-body">新闻资讯</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="/home/photoList">
          <img src="./../../assets/images/share.jpg">
          <div class="mui-media-body">图片分享</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="#">
          <img src="./../../assets/images/shop.jpg">
          <div class="mui-media-body">商品购买</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="#">
          <img src="./../../assets/images/comment.jpg">
          <div class="mui-media-body">留言反馈</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="#">
          <img src="./../../assets/images/logo.png">
          <div class="mui-media-body">帮助手册</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><router-link to="#">
          <img src="./../../assets/images/feedback.jpg">
          <div class="mui-media-body">联系我们</div>
        </router-link>
      </li>
		</ul> 

  </div>
</template>

<script>
import { Toast } from 'mint-ui'
export default {
  data() {
    return {
      swipe:null
    }
  },
  created() {
    this.axios.get('/api/swipe').then(body=>{
      if (body.data.status === 1) {
        this.swipe = body.data.message
      }else{
        Toast("加载轮播图失败")
      }
    });
  }
}
</script>

<style scoped lang="less">
  .home{
    .mint-swipe{
      height: 12em;
      .mint-swipe-item{
        width: 100%;
        height: 12em;
        img{
          width: 100%;
          height: 100%;
        }
      }
    }
    .mui-grid-view.mui-grid-9 {
      border: none;
      background-color: #fff;
      .mui-table-view-cell{
        border: none;
        img{
          width:60px;
          height: 60px;
          border-radius: 25%;
        }
      }
    }
  }
</style>
